// apps/server/src/routes/posts.ts
import { zValidator } from "@hono/zod-validator";
import { Hono } from "hono";
import { z } from "zod";

const posts = new Hono().post(
  "/",
  zValidator(
    "form",
    z.object({
      title: z.string(),
      body: z.string(),
    }),
  ),
  (c) => {
    // 业务逻辑
    return c.json({ ok: true, message: "Created!" }, 201);
  },
);

export default posts;
